<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>3d盒子</title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			boby{
				perspective: 800px;
			}
			.bigbox{
				position: relative;
				transform-style: preserve-3d;
				width: 400px;
				height: 400px;
				/* border: 1px solid red; */
				/* position: absolute; */
				margin: 200px auto;
				transform: rotateX(45deg) rotateY(60deg);
				
			}
			.bigbox div{
				position: absolute;
				top: 0;
				left: 0;
				width: 200px;
				height: 300px;
				border: 1px solid #ffa500;
				font-size: 36px;
				color: black;
				text-align: center;
				line-height: 300px;
				transition: all 2s linear;
			}
			.bigbox div:nth-child(1){
				transform: translateZ(100px);
				background-color: rgba(105, 255, 71, 0.5);
			}
			.bigbox div:nth-child(2){
				transform: translateZ(-100px);
				background-color: rgba(255, 255, 81, 0.5);
			}
			.bigbox div:nth-child(3){
				transform: translateX(100px) rotateY(90deg);
				
			}
			.bigbox div:nth-child(4){
				transform: translateX(-100px) rotateY(90deg);
			}
			.bigbox div:nth-child(5){
				transform: translateY(-100px) rotateX(90deg);
			}
			.bigbox div:nth-child(6){
				transform: translateY(200px) rotate(90deg);
			}
			.bigbox:hover .box1{
				transform: translateZ(200px);
			}
			.bigbox:hover .box2{
				transform: translateZ(-200px);
			}
			.bigbox:hover .box3{
				transform: translateX(200px) ;
			}
		</style>
	</head>
	<body>
		<div class="bigbox">
			<div class="box1">1</div>
			<div class="box2">2</div>
			<div class="box3">3</div>
			<div class="box4">4</div>
			<div class="box5">5</div>
			<div class="box6">6</div>
		</div>
	</body>
</html>